import httpProxy from "../utils/request"; // 拿到我们刚封装的axios
import { URL } from "../config";

const BASE_URL = `http://1.116.178.22/kuangcai_serve`

// 获取列表
export async function getSpace(data:any) {
  return await httpProxy({
    url: BASE_URL + `/admin/space/type/page`,
    method: "POST",
    data
  });
}

// 根据id获取所有图片
export async function getPic(data:any){
  return await httpProxy({
    url: BASE_URL + `/admin/space/info/page`,
    method: "POST",
    data
  });
}

// 添加列表项
export async function addItemName(data:any){
  return await httpProxy({
    url:BASE_URL + `/admin/space/type/add`,
    method:"post",
    data
  })
}

// 删除列表项
export async function handleListItem(data:any){
  return await httpProxy({
    url:BASE_URL + `/admin/space/type/delete`,
    method:"post",
    data
  })
}

// 修改列表某一项名称
export async function handleItemNmae(data:any){
  return await httpProxy({
    url:BASE_URL + `/admin/space/type/update`,
    method:"post",
    data
  })
}

// 单独删除某一张图片
export async function handleDeleteImage(data:any){
  return await httpProxy({
    url:BASE_URL + `/admin/space/info/delete`,
    method:"post",
    data
  })
}

// 修改用户信息
export async function handleUserInfo(data:any) {
    return await httpProxy({
      url:BASE_URL + `/admin/base/comm/personUpdate`,
      method:"post",
      data
    })
} 